package com.margo.project.web.session.listener;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationListener;
import org.springframework.session.events.SessionCreatedEvent;
import org.springframework.stereotype.Component;

/**
 * session创建监听
 * @author fangxingbang
 *
 */
@Component
public class MargoSessionCreatedListener implements ApplicationListener<SessionCreatedEvent>{

	private Logger logger=LoggerFactory.getLogger(this.getClass());
	
	@Override
	public void onApplicationEvent(SessionCreatedEvent event) {
		 String sessionId=event.getSessionId();
		 logger.info(sessionId);
	}

}
